using UnityEngine;
using System.Collections;

public class PopupWindow : MonoBehaviour {
	
	public enum AlertMessageType{
		PlayerNameIsEmpty,
		PlayerNameIsIllegal,
	}
	
	public UISprite messageSprite;
	public UILabel messageLabel;
	
	// Use this for initialization
	void Start () {
		if(!messageSprite) return;
	}
	
	// Update is called once per frame
	void Update () {
		
	}
	
	public void ShowAlertMessage(AlertMessageType messageType){
		messageSprite.enabled = true;
		switch(messageType){
			case AlertMessageType.PlayerNameIsEmpty :
				messageSprite.spriteName = "error_prompt_word";
				messageSprite.MakePixelPerfect();
				break;
			case AlertMessageType.PlayerNameIsIllegal:
				messageSprite.spriteName = "error_prompt_word2";
				messageSprite.MakePixelPerfect();
				break;
		}
		//UIManagement.Instance().SetVisiable(GameDefine.VISIABLE);
		gameObject.SetActive(true);
	}
	
	public void ShowAlertMessage(string message){
		messageLabel.text = message;
		messageSprite.enabled = false;
		
		gameObject.SetActive(true);
	}
}
